#ifndef __ESP8266_H__
#define __ESP8266_H__

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stm32f10x.h>

#define ESP8266_RX_ENABLE 1 // ESP8266接收使能

#define ESP8266_RX_BUFF_SIZE 512 // ESP8266接收缓冲区大小
extern char ESP8266_RX_BUFF[ESP8266_RX_BUFF_SIZE];
extern unsigned short ESP8266_RX_STA;

extern uint8_t Temperature;
extern uint8_t Humidity;
extern int WorkTime;
extern int PowerSwitch;

void ESP8266_Init(void);
void MQTT_Init(void);
void ESP8266_Clear(void);
bool ESP8266_WaitRecive(void);
bool ESP8266_SendCmd(char *cmd, char *res,u32 Timeout);
bool ESP8266_SendData(void);
void CommandAnalyse(void);

#endif
